.class public Lcom/glympse/android/glympse/DlgSaveFavorite;
.super Lcom/glympse/android/glympse/DlgShell;
.source "DlgSaveFavorite.java"

# interfaces
.implements Lcom/glympse/android/glympse/DlgShell$DlgShellListener;


# instance fields
.field private m_oCheckShortcut:Landroid/widget/CheckBox;

.field private m_oDlgShellListenerForward:Lcom/glympse/android/glympse/DlgShell$DlgShellListener;

.field private m_oEditName:Landroid/widget/EditText;

.field private m_oTicket:Lcom/glympse/platform/common/Ticket;


# direct methods
.method public constructor <init>(Landroid/content/Context;Lcom/glympse/platform/common/Ticket;Lcom/glympse/android/glympse/DlgShell$DlgShellListener;)V
    .locals 2
    .parameter "oContext"
    .parameter "oTicket"
    .parameter "oDlgShellListener"

    .prologue
    const/4 v1, 0x0

    .line 34
    const v0, 0x7f03000b

    invoke-direct {p0, p1, v1, v0}, Lcom/glympse/android/glympse/DlgShell;-><init>(Landroid/content/Context;Ljava/lang/String;I)V

    .line 25
    iput-object v1, p0, Lcom/glympse/android/glympse/DlgSaveFavorite;->m_oDlgShellListenerForward:Lcom/glympse/android/glympse/DlgShell$DlgShellListener;

    .line 27
    iput-object v1, p0, Lcom/glympse/android/glympse/DlgSaveFavorite;->m_oTicket:Lcom/glympse/platform/common/Ticket;

    .line 28
    iput-object v1, p0, Lcom/glympse/android/glympse/DlgSaveFavorite;->m_oEditName:Landroid/widget/EditText;

    .line 29
    iput-object v1, p0, Lcom/glympse/android/glympse/DlgSaveFavorite;->m_oCheckShortcut:Landroid/widget/CheckBox;

    .line 35
    const v0, 0x7f02004c

    invoke-virtual {p0, v0}, Lcom/glympse/android/glympse/DlgSaveFavorite;->SetTitleIcon(I)V

    .line 36
    const v0, 0x7f0a0050

    invoke-virtual {p0, v0}, Lcom/glympse/android/glympse/DlgSaveFavorite;->SetTitleText(I)V

    .line 39
    iput-object p2, p0, Lcom/glympse/android/glympse/DlgSaveFavorite;->m_oTicket:Lcom/glympse/platform/common/Ticket;

    .line 40
    iput-object p3, p0, Lcom/glympse/android/glympse/DlgSaveFavorite;->m_oDlgShellListenerForward:Lcom/glympse/android/glympse/DlgShell$DlgShellListener;

    .line 43
    const v0, 0x7f0a005b

    invoke-virtual {p0, v0}, Lcom/glympse/android/glympse/DlgSaveFavorite;->SetOkText(I)V

    .line 44
    const v0, 0x7f0a0059

    invoke-virtual {p0, v0}, Lcom/glympse/android/glympse/DlgSaveFavorite;->SetCancelText(I)V

    .line 47
    invoke-virtual {p0, p0}, Lcom/glympse/android/glympse/DlgSaveFavorite;->SetDlgShellListener(Lcom/glympse/android/glympse/DlgShell$DlgShellListener;)V

    .line 50
    iget-object v0, p0, Lcom/glympse/android/glympse/DlgSaveFavorite;->m_oViewGroupPanel:Landroid/view/ViewGroup;

    const v1, 0x7f0c0031

    invoke-virtual {v0, v1}, Landroid/view/ViewGroup;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/EditText;

    iput-object v0, p0, Lcom/glympse/android/glympse/DlgSaveFavorite;->m_oEditName:Landroid/widget/EditText;

    .line 51
    iget-object v0, p0, Lcom/glympse/android/glympse/DlgSaveFavorite;->m_oEditName:Landroid/widget/EditText;

    invoke-virtual {p2}, Lcom/glympse/platform/common/Ticket;->CreateName()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/EditText;->setText(Ljava/lang/CharSequence;)V

    .line 54
    iget-object v0, p0, Lcom/glympse/android/glympse/DlgSaveFavorite;->m_oViewGroupPanel:Landroid/view/ViewGroup;

    const v1, 0x7f0c0032

    invoke-virtual {v0, v1}, Landroid/view/ViewGroup;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/CheckBox;

    iput-object v0, p0, Lcom/glympse/android/glympse/DlgSaveFavorite;->m_oCheckShortcut:Landroid/widget/CheckBox;

    .line 55
    return-void
.end method


# virtual methods
.method public OnCancel(Lcom/glympse/android/glympse/DlgShell;)V
    .locals 1
    .parameter "oDlgShell"

    .prologue
    .line 75
    iget-object v0, p0, Lcom/glympse/android/glympse/DlgSaveFavorite;->m_oDlgShellListenerForward:Lcom/glympse/android/glympse/DlgShell$DlgShellListener;

    if-eqz v0, :cond_0

    .line 77
    iget-object v0, p0, Lcom/glympse/android/glympse/DlgSaveFavorite;->m_oDlgShellListenerForward:Lcom/glympse/android/glympse/DlgShell$DlgShellListener;

    invoke-interface {v0, p1}, Lcom/glympse/android/glympse/DlgShell$DlgShellListener;->OnCancel(Lcom/glympse/android/glympse/DlgShell;)V

    .line 79
    :cond_0
    return-void
.end method

.method public OnDismissed(Lcom/glympse/android/glympse/DlgShell;Z)V
    .locals 4
    .parameter "oDlgShell"
    .parameter "fOk"

    .prologue
    const/4 v3, 0x0

    .line 85
    if-eqz p2, :cond_1

    iget-object v1, p0, Lcom/glympse/android/glympse/DlgSaveFavorite;->m_oEditName:Landroid/widget/EditText;

    if-eqz v1, :cond_1

    iget-object v1, p0, Lcom/glympse/android/glympse/DlgSaveFavorite;->m_oTicket:Lcom/glympse/platform/common/Ticket;

    if-eqz v1, :cond_1

    .line 88
    iget-object v1, p0, Lcom/glympse/android/glympse/DlgSaveFavorite;->m_oEditName:Landroid/widget/EditText;

    invoke-virtual {v1}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v1

    invoke-interface {v1}, Landroid/text/Editable;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v0

    .line 89
    .local v0, strName:Ljava/lang/String;
    invoke-virtual {v0}, Ljava/lang/String;->length()I

    move-result v1

    if-gtz v1, :cond_0

    .line 91
    iget-object v1, p0, Lcom/glympse/android/glympse/DlgSaveFavorite;->m_oTicket:Lcom/glympse/platform/common/Ticket;

    invoke-virtual {v1}, Lcom/glympse/platform/common/Ticket;->CreateName()Ljava/lang/String;

    move-result-object v0

    .line 95
    :cond_0
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v1

    iget-object v1, v1, Lcom/glympse/platform/Platform;->m_oFavoriteList:Lcom/glympse/platform/common/FavoriteList;

    iget-object v2, p0, Lcom/glympse/android/glympse/DlgSaveFavorite;->m_oTicket:Lcom/glympse/platform/common/Ticket;

    invoke-virtual {v1, v2, v0}, Lcom/glympse/platform/common/FavoriteList;->Add(Lcom/glympse/platform/common/Ticket;Ljava/lang/String;)V

    .line 98
    iget-object v1, p0, Lcom/glympse/android/glympse/DlgSaveFavorite;->m_oCheckShortcut:Landroid/widget/CheckBox;

    if-eqz v1, :cond_1

    iget-object v1, p0, Lcom/glympse/android/glympse/DlgSaveFavorite;->m_oCheckShortcut:Landroid/widget/CheckBox;

    invoke-virtual {v1}, Landroid/widget/CheckBox;->isChecked()Z

    move-result v1

    if-eqz v1, :cond_1

    .line 100
    sget-object v1, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    iget-object v2, p0, Lcom/glympse/android/glympse/DlgSaveFavorite;->m_oTicket:Lcom/glympse/platform/common/Ticket;

    invoke-virtual {v1, v2, v0}, Lcom/glympse/android/glympse/Glympse;->CreateDesktopShortcut(Lcom/glympse/platform/common/Ticket;Ljava/lang/String;)V

    .line 104
    .end local v0           #strName:Ljava/lang/String;
    :cond_1
    iget-object v1, p0, Lcom/glympse/android/glympse/DlgSaveFavorite;->m_oDlgShellListenerForward:Lcom/glympse/android/glympse/DlgShell$DlgShellListener;

    if-eqz v1, :cond_2

    .line 106
    iget-object v1, p0, Lcom/glympse/android/glympse/DlgSaveFavorite;->m_oDlgShellListenerForward:Lcom/glympse/android/glympse/DlgShell$DlgShellListener;

    invoke-interface {v1, p1, p2}, Lcom/glympse/android/glympse/DlgShell$DlgShellListener;->OnDismissed(Lcom/glympse/android/glympse/DlgShell;Z)V

    .line 108
    :cond_2
    iput-object v3, p0, Lcom/glympse/android/glympse/DlgSaveFavorite;->m_oDlgShellListenerForward:Lcom/glympse/android/glympse/DlgShell$DlgShellListener;

    .line 110
    iput-object v3, p0, Lcom/glympse/android/glympse/DlgSaveFavorite;->m_oTicket:Lcom/glympse/platform/common/Ticket;

    .line 111
    iput-object v3, p0, Lcom/glympse/android/glympse/DlgSaveFavorite;->m_oEditName:Landroid/widget/EditText;

    .line 112
    iput-object v3, p0, Lcom/glympse/android/glympse/DlgSaveFavorite;->m_oCheckShortcut:Landroid/widget/CheckBox;

    .line 113
    return-void
.end method

.method public OnOk(Lcom/glympse/android/glympse/DlgShell;)V
    .locals 1
    .parameter "oDlgShell"

    .prologue
    .line 66
    iget-object v0, p0, Lcom/glympse/android/glympse/DlgSaveFavorite;->m_oDlgShellListenerForward:Lcom/glympse/android/glympse/DlgShell$DlgShellListener;

    if-eqz v0, :cond_0

    .line 68
    iget-object v0, p0, Lcom/glympse/android/glympse/DlgSaveFavorite;->m_oDlgShellListenerForward:Lcom/glympse/android/glympse/DlgShell$DlgShellListener;

    invoke-interface {v0, p1}, Lcom/glympse/android/glympse/DlgShell$DlgShellListener;->OnOk(Lcom/glympse/android/glympse/DlgShell;)V

    .line 70
    :cond_0
    return-void
.end method

.method protected onCreate(Landroid/os/Bundle;)V
    .locals 0
    .parameter "savedInstanceState"

    .prologue
    .line 60
    invoke-super {p0, p1}, Lcom/glympse/android/glympse/DlgShell;->onCreate(Landroid/os/Bundle;)V

    .line 61
    return-void
.end method
